import Vue from 'vue'
import VueRouter from 'vue-router'
import index from "@/components/index";
import customer from "@/components/customer/customer";
import shopclassify from "@/components/shopclassify/shopclassify";
import shopjia from "@/components/shop/shopjia";
import userManege from "@/components/login/userManege";
import register from "@/components/login/register";
import login from "@/components/login/login";
import staffjia from "@/components/staff/staffjia";
import shopclassifyjia from "@/components/shopclassify/shopclassifyjia"
import salesorderjia from "@/components/salesorder/salesorderjia"
import customerjia from "@/components/customer/customerjia"
import shop from "@/components/shop/shop"
import staff from "@/components/staff/staff"
import salesorder from "@/components/salesorder/salesorder"
import indexcustomer from "@/components/indexcustomer"
import image1 from "@/components/assets/project";
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
Vue.use(VueRouter)
const router = new VueRouter({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'login',
      component: login,
      meta:{
        title: '首页'
      },
    },
      {
          path: '/indexcustomer1',
          name: 'indexcustomer1',
          component: indexcustomer,
      },
    {
      path: '/register',
      name: 'register',
      component: register
    },
    {
      path: '/index',
      name: 'index',
      component: index,
      children:[
          {
              path: '/project',
              name: 'project',
              component: image1,
          },
        {
      path: '/indexcustomer',
      name: 'indexcustomer',
      component: indexcustomer,
    },
        {
          path:'/salesorderjia',
          component:salesorderjia
        },
        {
          path:'/customerjia',
          component:customerjia
        },
        {
          path:'/shop',
          component:shop
        },
        {
          path:'/staffjia',
          component:staffjia
        },
        {
          path:'/shopclassifyjia',
          component:shopclassifyjia
        },
        {
          path:'/shopjia',
          component:shopjia
        },
        {
          path:'/shopclassify',
          component:shopclassify
        },
        {
          path:'/staff',
          component:staff
        },
        {
          path:'/customer',
          component:customer
        },
        {
          path:'/salesorder',
          component:salesorder
        },
        {
          path:'/userManege',
          component:userManege
        },
      ]
    },
  ]
})
export default router
